tpm: Enable hwrng only for Pluton on AMD CPUs
authorJarkko Sakkinen <jarkko@kernel.org>
Mon, 4 Sep 2023 18:12:10 +0000 (21:12 +0300)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 7 Sep 2023 07:39:52 +0000 (08:39 +0100)
commitaeebd48a46d602259245fc1abf0ea2856247e48b
tree6f6106745379ae9999af6194d78699b330f75b18
parent247923e107b957386312e61ed5e7893a9c153e23
tpm: Enable hwrng only for Pluton on AMD CPUs

Origin: https://git.kernel.org/linus/8f7f35e5aa6f2182eabcfa3abef4d898a48e9aa8

The vendor check introduced by commit 554b841d4703 ("tpm: Disable RNG for
all AMD fTPMs") doesn't work properly on a number of Intel fTPMs.  On the
reported systems the TPM doesn't reply at bootup and returns back the
command code. This makes the TPM fail probe on Lenovo Legion Y540 laptop.

Since only Microsoft Pluton is the only known combination of AMD CPU and
fTPM from other vendor, disable hwrng otherwise. In order to make sysadmin
aware of this, print also info message to the klog.

Cc: stable@vger.kernel.org
Fixes: 554b841d4703 ("tpm: Disable RNG for all AMD fTPMs")
Reported-by: Todd Brandt <todd.e.brandt@intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217804
Reported-by: Patrick Steinhardt <ps@pks.im>
Reported-by: Raymond Jay Golo <rjgolo@gmail.com>
Reported-by: Ronan Pigott <ronan@rjp.ie>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name tpm-Enable-hwrng-only-for-Pluton-on-AMD-CPUs.patch
drivers/char/tpm/tpm_crb.c